gestures: Make claiming button release work
authorMatthias Clasen <mclasen@redhat.com>
Mon, 14 Sep 2020 12:35:44 +0000 (08:35 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 14 Sep 2020 12:35:44 +0000 (08:35 -0400)
commit53dddf163de2b16d6140a47240e07925a529639d
tree56a4f5b16b3b7270a276af7a2b159ba385a81221
parent6a676d527cfba7be1d59310de6dd19cb61898a38
gestures: Make claiming button release work

When claiming a sequence in a gesture signal handler,
the expected result is that GtkGesture::handle-event
returns TRUE, causing the event to not be propagated
further.

This doesn't work for button release events, since
gtk_gesture_handle_event does the following:
  add point
  emit ::update
  remove point
  check claimed status
The ::update signal is where the application code
claims the sequence. But removing the point purges
the sequence from the gestures memory, so checking
the claimed status returns FALSE.

This patch fixes things to behave as expected, by
checking the claimed status before removing the point.
gtk/gtkgesture.c